class_name PlayerStateMachine
extends GameplayStateMachine

@onready var player: Player = $"../"


func _on_setup() -> void:
	var multiway_transition := MultiwayStateTransition.new(
		[func(): return 0 if player.state_checker.is_on_ground else 1],
		{
			[0]: "GroundState",
			[1]: "AirState",
		}
	)
	add_transition("AnyState", multiway_transition)

	blackboard["combo_timer"] = 0.0


func _on_update(delta: float) -> void:
	blackboard["combo_timer"] -= delta


func _ready() -> void:
	on_setup()


func _process(delta: float) -> void:
	on_update(delta)
